//导入js-cookie
import Cookies from 'js-cookie'

//设置token变量
const TokenKey = 'hr-token'

//获取token
export function getToken() {
    return Cookies.get(TokenKey)
}

//存token
export function setToken(token) {
    return Cookies.set(TokenKey, token)
}

//移除token
export function removeToken() {
    return Cookies.remove(TokenKey)
}


//设置存入token的时间戳
const tokenTime = 'hr-tokenTime'

//存入时间戳
export function setTimeStamp() {
    return Cookies.set(tokenTime, Date.now())
}

//获取时间戳
export function getTimeStamp() {
    return Cookies.get(tokenTime)
}

//移除时间戳
export function removeTimeStamp() {
    return Cookies.remove(tokenTime)
}